package org.example.java.base;

/**
 * Created by Juntao.Zhang on 2014/8/7.
 */
public class TryTest {
  public static int test(boolean isException) {
    try {
      if (isException) {
        throw new Exception("test");
      }
      return 1;
    } catch (Exception e) {
      e.printStackTrace();
      return 2;
    } finally {
      System.out.println("finally");
      return 3;
    }

  }

  public static void main(String[] args) {
    System.out.println(test(true));
    System.out.println(test(false));
  }
}
